const path = require('path')
function resolve(dir) {
    return path.join(__dirname, dir)
}
const webpack = require('webpack')
module.exports = {
    devServer: {//配置请求跨域,配置后需要重启项目
        open: true,
        proxy: {
            '/api': {
                target: 'http://192.168.1.5:8030',
                changeOrigin: true,
                ws: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    },

    configureWebpack: config => {
        config.resolve = {
            extensions: ['.js', '.vue', '.json'],
            alias: {
                'vue$': 'vue/dist/vue.esm.js',
                '@': resolve('src'),
            }
        }
    },
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                "windows.jQuery": "jquery"
            })
        ]
    }
}           